//
//  Drop+DateComponents.swift
//  Drop
//
//  Created by hushaohua on 2018/2/19.
//  Copyright © 2018年 init. All rights reserved.
//

import Foundation

extension Drop{
    func configDateComponents() -> Void{
        var calendar:Calendar = Calendar.current;
        calendar.firstWeekday = 2;
        let components = calendar.dateComponents([.year, .yearForWeekOfYear, .weekOfYear, .month, .day, .weekday], from: self.begin! as Date);
        self.year = Int32(components.year!);
        self.yearForWeek = Int32(components.yearForWeekOfYear!);
        self.weekOfYear = Int16(components.weekOfYear!);
        self.month = Int16(components.month!);
        self.day = Int16(components.day!);
        self.weekday = Int16(components.weekday!);
    }
}
